#include <myheader.h>
//定义一个学生结构体类型struct student，里边含有学号，
//姓名，分数；定义结构体数组struct student s[3],给数组赋初值
//后，写入文件。然后再读取文件, 把信息读取出来进行打印输出.
typedef struct student{
    int num;
    char name[20];
    int score;
}student;


/* Usage:  */
int main(int argc, char *argv[]){                                  
    struct student s[3]={
        {1,"zs",90},
        {2,"ls",80}, 
        {3,"ww",70},
    };
    FILE* fd=fopen(argv[1],"r");
    ERROR_CHECK(fd,NULL,"fopen");

    for(int i=0;i<3;i++){
    fprintf(fd,"num:%d,name:%s,score:%d",s[i].num,s[i].name,s[i].score);
    }
    
    fclose(fd);    
    return 0;
}

